<?php

namespace app\controllers;

use Yii;
use yii\web\Controller;
use yii\web\Request;
use yii\web\Response;
use proxy\HttpProxy;
use helper\SessionHelper;

class OpController extends SecBaseController
{
    public $proxy = null;
    public $remote_params = [];
    public $return_page_values = [];
    public $enableCsrfValidation = false;    
    public $session = null;    
    public $headers = null;    
    

    public function actionCoupon()
    {

        // var_dump($this->auth) ; exit ; 
        // if($this->auth->assert($this->session->get('admin_user_id'),'op_coupon')){
            
            return $this->myRenderFile('@tpl/page/op/couponmanage.tpl', $this->return_page_values);
        // }else{
        //     header('Location: http://admintest.quleyuan.com.cn/login');
        // }
    }



     public function actionTest()
    {

        //phpinfo();exit; 
        $request = Yii::$app->request;
        //echo $request->getPathInfo(); exit;
        echo var_dump($request->getQueryParams());
        echo var_dump($request->getBodyParams());
        echo var_dump($this->remote_params);
        $objPHPExcel = \PHPExcel_IOFactory::load('./test.xlsx');
        $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true);
        print_r($sheetData);


        exit;
        if($this->auth->checkAccess($this->session->get('admin_user_id'),'op_coupon')){
            return $this->myRenderFile('@tpl/page/op/couponmanage.tpl', $this->return_page_values);
        }else{
            //header('Location:'.Yii::$app->params['HOST'].'/login');
            return $this->myRedirect('/login');
        }
        
        
    
    }
    
}
